package org.hashdb.client.util.event;

import java.util.function.Consumer;

/**
 * Date: 2024/1/21 15:02
 *
 * @author huanyuMake-pecdle
 * @version 0.0.1
 */
public interface IEventEngin<E extends IEventEngin<E>> {
    E register(Object eventKey, Consumer<Object> listener);

    E unregister(Object eventKey, Consumer<Object> listener);

    E unregisterNotFound(Consumer<NotFountEvent> listener);

    E registerNotFound(Consumer<NotFountEvent> listener);

    E publishAsync(Object eventKey, Object message);

    void publishBeforePublish();

    E publish(Object eventKey);

    E publish(Object eventKey, Object message);

    Consumer<NotFountEvent> getDefaultNotFoundListener();

    void setCatchPublish(boolean catchPublish);
}
